/*
 * $Id: XModel.java 136 2009-07-16 07:53:43Z donbeave $
 */

package labour.concept.client.data;

import java.util.Collection;
import java.util.Map;

public abstract class XModel<D extends BaseModel> implements com.extjs.gxt.ui.client.data.ModelData {

  private D model;
  private ConceptManager manager;

  public XModel(D model, ConceptManager manager) {
    this.model = model;
    this.manager = manager;
  }

  public D getModel() {
    return model;
  }

  protected void setModel(D model) {
    this.model = model;
  }

  public ConceptManager getManager() {
    return manager;
  }

  @SuppressWarnings("unchecked")
  public <X> X get(String property) {
    return (X) model.get(property);
  }

  public Map<String, java.lang.Object> getProperties() {
    return model.getProperties();
  }

  public Collection<String> getPropertyNames() {
    return model.getPropertyNames();
  }

  @SuppressWarnings("unchecked")
  public <X> X remove(String property) {
    return (X) model.remove(property);
  }

  public <X> X set(String property, X value) {
    return model.set(property, value);
  }

}
